<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <title>Title</title>
</head>
<body>
<div>

    <span id="ii" th:value="${id}" th:text="${id}"></span>
    <span th:onclick="pay()">付款</span>

</div>
</body>
<script>
    function pay() {
        let id = document.getElementById("ii").innerHTML
        window.location.href="http://127.0.0.1:8001/pay/"+id
    }
</script>
</html>